package com.ym.pms.controller;

import com.ym.pms.service.DisplayService;
import com.ym.pms.service.SuiteService;
import com.ym.pms.utils.JSONResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@Api(tags = "房源数据展示接口")
@RequestMapping("/display")
public class DisplayController {
    @Autowired
    DisplayService service;

    @ApiOperation(value = "获取宿舍信息(room)" , notes = "包含：key<key>，区域名<regionName>，项目名<itemName>，楼栋名<buildingName>，" +
                                                        "套房名<suiteName>，物业名<CName>，所在楼层<floor>，房间数量<roomNum>，" +
                                                        "最低租金（元/床位）<MinMoney>， 套房描述<remark> ，样式码<itemStyle>，" +
                                                        "套房编码<suCoding>，楼栋编码<buCoding>，项目编码<itCoding>")
    @GetMapping("/dormitory")
    @ApiImplicitParam(name = "gender", value = "当前登录用户性别", required = true, dataType = "String")
    public JSONResult dormitoryInformation(@RequestParam("gender") String gender){
        List<Map<String, String>> maps = service.dormitoryInformation(gender);
        return JSONResult.ok(maps);
    }



}
